Static Public Member Functions | Data Fields | Static Protected Attributes

vfsStream Class Reference

Static Public Member Functions

static url ($path)
static path ($url)
static umask ($umask=null)
static setup ($rootDirName= 'root', $permissions=null)
static newFile ($name, $permissions=null)
static newDirectory ($name, $permissions=null)
static getCurrentUser ()
static getCurrentGroup ()

Data Fields

const SCHEME = 'vfs'
const OWNER_ROOT = 0
const OWNER_USER_1 = 1
const OWNER_USER_2 = 2
const GROUP_ROOT = 0
const GROUP_USER_1 = 1
const GROUP_USER_2 = 2

Static Protected Attributes

static $umask = 0000

Member Function Documentation

static getCurrentGroup (  ) [static]

returns current group

If the system does not support posix_getgid() the current group will be root (0).

Returns:
int
static getCurrentUser (  ) [static]

returns current user

If the system does not support posix_getuid() the current user will be root (0).

Returns:
int
static newDirectory ( name,
permissions = null 
) [static]

returns a new directory with given name

If the name contains slashes, a new directory structure will be created. The returned directory will always be the parent directory of this directory structure.

Parameters:
string$name
int$permissionsoptional
Returns:
vfsStreamDirectory
static newFile ( name,
permissions = null 
) [static]

returns a new file with given name

Parameters:
string$name
int$permissionsoptional
Returns:
vfsStreamFile
static path ( url ) [static]

restores the path from the url

Parameters:
string$url
Returns:
string
static setup ( rootDirName = 'root',
permissions = null 
) [static]

helper method for setting up vfsStream in unit tests

Instead of vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(vfsStream::newDirectory('root')); you can simply do vfsStream::setup() which yields the same result. Additionally, the method returns the freshly created root directory which you can use to make further adjustments to it.

Parameters:
string$rootDirNameoptional name of root directory
int$permissionsoptional file permissions of root directory
Returns:
vfsStreamDirectory
Since:
0.7.0
static umask ( umask = null ) [static]

sets new umask setting and returns previous umask setting

If no value is given only the current umask setting is returned.

Parameters:
int$umaskoptional
Returns:
int
Since:
0.8.0
static url ( path ) [static]

prepends the scheme to the given URL

Parameters:
string$path
Returns:
string

Field Documentation

const GROUP_ROOT = 0

group: root

const GROUP_USER_1 = 1

group: user 1

const GROUP_USER_2 = 2

group: user 2

const OWNER_ROOT = 0

owner: root

const OWNER_USER_1 = 1

owner: user 1

const OWNER_USER_2 = 2

owner: user 2

const SCHEME = 'vfs'

url scheme


The documentation for this class was generated from the following file: